package com.example.anitamusicspace.service;

import com.example.anitamusicspace.mapper.LoveMusicMapper;
import com.example.anitamusicspace.model.Music;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 小梅就是酱子
 * Date: 2022-08-25
 * Time: 20:17
 */
@Service
public class LoveMusicService {
    @Resource
    private LoveMusicMapper loveMusicMapper;

    public Music findLoveMusicByMusicIdAndUserId(int userId, int musicId){
        return loveMusicMapper.findLoveMusicByMusicIdAndUserId(userId,musicId);
    }

    public boolean insertLoveMusic(int userId, int musicId){
        return loveMusicMapper.insertLoveMusic(userId,musicId);
    }

    public int deleteLoveMusic(int userId,int musicId){
        return loveMusicMapper.deleteLoveMusic(userId,musicId);
    }

    public List<Music> findLoveMusicByUserId(int userId){
        return loveMusicMapper.findLoveMusicByUserId(userId);
    }

    public List<Music> findLoveMusicBykeyAndUID(String musicName, int userId){
        return loveMusicMapper.findLoveMusicBykeyAndUID(musicName,userId);
    }

    public int deleteLoveMusicById(int musicId){
        return loveMusicMapper.deleteLoveMusicById(musicId);
    }
}
